<response>
	<token><?php echo $token; ?></token>
	<status><?php echo $status; ?></status>
	<action_name><?php echo $actionName; ?></action_name>
<?php
if (isset($asessionlog['Asessionresult'])){
?>
	<return_values>
<?php 
	
	$return_value_count = 0;
	
	foreach ($asessionlog['Asessionresult'] as $asessionresult){
?>
		<return_value_<?php echo $return_value_count;?>><?php echo $asessionresult['Answer']['return_value'];?></return_value_<?php echo $return_value_count;?>>
<?php
		$return_value_count ++;
	}

?>
	</return_values>
	<return_value_count><?php echo $return_value_count; ?></return_value_count>
	<answer_values>
<?php 
	
	$answer_value_count = 0;
	
	foreach ($asessionlog['Asessionresult'] as $asessionresult){
?>
		<answer_value_<?php echo $answer_value_count;?>>
<?php 
		if ($asessionresult['Answer']['answer_text'] == ''){
			$asessionresult['Answer']['answer_text'] = $asessionresult['Answer']['answer_int'];
		}
		echo $asessionresult['Answer']['answer_text'];
?></answer_value_<?php echo $answer_value_count;
?>>
<?php
		$answer_value_count ++;
	}

?>
	</answer_values>
	<answer_value_count><?php echo $answer_value_count; ?></answer_value_count>
<?php
}
?>
</response>